<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>RCX Motor MUX<br/>
<small>
[<a class="el" href="group__mindsensors.html">Mindsensors</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mindsensors-rcxmotormux_8h.html">mindsensors-rcxmotormux.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>RobotC Mindsensors RCX Motor MUX Driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msmtrmx.html#ga7781014c111bfa3313bfed7754297e3f">MSMTRMX_I2C_ADDR</a>&#160;&#160;&#160;0xB4</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msmtrmx.html#gabef3c5f24192db815003a684866353cf">MSMTRMX_MOTOR_REG</a>&#160;&#160;&#160;0x42</td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msmtrmx.html#ga31f25843746b208a87d793fcad243c29">tMSMTRMXSettings</a> { <a class="el" href="group__msmtrmx.html#gga31f25843746b208a87d793fcad243c29a80f6b1c803bb06040db747f79e10f647">MSMTRMX_MODE_FLOAT</a> =  0, 
<a class="el" href="group__msmtrmx.html#gga31f25843746b208a87d793fcad243c29a19f9761620eee8451c2c17731e1d31ef">MSMTRMX_MODE_FORWARD</a> =  1, 
<a class="el" href="group__msmtrmx.html#gga31f25843746b208a87d793fcad243c29aca501021be8cad3959e95fdea6a728e3">MSMTRMX_MODE_REVERSE</a> =  2, 
<a class="el" href="group__msmtrmx.html#gga31f25843746b208a87d793fcad243c29aac0953c88f2a1483f46c76e66bb13396">MSMTRMX_MODE_BRAKE</a> =  3
 }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msmtrmx.html#gac6569ab3e3f6a2aa0bd679d2a18b36c5">tMSMTRMXMotors</a> { <a class="el" href="group__msmtrmx.html#ggac6569ab3e3f6a2aa0bd679d2a18b36c5a64f2d42d079c42b6c817dd6a197c7f44">MSMTRMX_M1</a> =  0, 
<a class="el" href="group__msmtrmx.html#ggac6569ab3e3f6a2aa0bd679d2a18b36c5a1ec8ccc91490001f794abb74979f12c7">MSMTRMX_M2</a> =  1, 
<a class="el" href="group__msmtrmx.html#ggac6569ab3e3f6a2aa0bd679d2a18b36c5ae77b9eca6f4279743c890c36964f04df">MSMTRMX_M3</a> =  2, 
<a class="el" href="group__msmtrmx.html#ggac6569ab3e3f6a2aa0bd679d2a18b36c5ad113520b7e049da15197e33030406c1c">MSMTRMX_M4</a> =  3
 }</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msmtrmx.html#ga9d123ef3b2b23693ca20680d36039eab">MSMTRMX_Control</a> (tSensors link, <a class="el" href="group__msmtrmx.html#gac6569ab3e3f6a2aa0bd679d2a18b36c5">tMSMTRMXMotors</a> channel, int power, ubyte address=MSMTRMX_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msmtrmx.html#ga715a0828ba4632b83617903093132021">MSMTRMX_Brake</a> (tSensors link, <a class="el" href="group__msmtrmx.html#gac6569ab3e3f6a2aa0bd679d2a18b36c5">tMSMTRMXMotors</a> channel, unsigned byte brakeForce, ubyte address=MSMTRMX_I2C_ADDR)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msmtrmx.html#ga42f810b071ebd8aad64978a3e4c9f35e">MSMTRMX_I2CMessage</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>RCX Motor MUX </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga7781014c111bfa3313bfed7754297e3f"></a><!-- doxytag: member="mindsensors&#45;rcxmotormux.h::MSMTRMX_I2C_ADDR" ref="ga7781014c111bfa3313bfed7754297e3f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MSMTRMX_I2C_ADDR&#160;&#160;&#160;0xB4</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>i2c address/registers MSMTRMX I2C device address </p>

<p>Definition at line <a class="el" href="mindsensors-rcxmotormux_8h_source.html#l00033">33</a> of file <a class="el" href="mindsensors-rcxmotormux_8h_source.html">mindsensors-rcxmotormux.h</a>.</p>

</div>
</div>
<a class="anchor" id="gabef3c5f24192db815003a684866353cf"></a><!-- doxytag: member="mindsensors&#45;rcxmotormux.h::MSMTRMX_MOTOR_REG" ref="gabef3c5f24192db815003a684866353cf" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MSMTRMX_MOTOR_REG&#160;&#160;&#160;0x42</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Motor address </p>

<p>Definition at line <a class="el" href="mindsensors-rcxmotormux_8h_source.html#l00034">34</a> of file <a class="el" href="mindsensors-rcxmotormux_8h_source.html">mindsensors-rcxmotormux.h</a>.</p>

</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="gac6569ab3e3f6a2aa0bd679d2a18b36c5"></a><!-- doxytag: member="mindsensors&#45;rcxmotormux.h::tMSMTRMXMotors" ref="gac6569ab3e3f6a2aa0bd679d2a18b36c5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__msmtrmx.html#gac6569ab3e3f6a2aa0bd679d2a18b36c5">tMSMTRMXMotors</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>motors struct, these are the four motor channels on the MUX </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="ggac6569ab3e3f6a2aa0bd679d2a18b36c5a64f2d42d079c42b6c817dd6a197c7f44"></a><!-- doxytag: member="MSMTRMX_M1" ref="ggac6569ab3e3f6a2aa0bd679d2a18b36c5a64f2d42d079c42b6c817dd6a197c7f44" args="" -->MSMTRMX_M1</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac6569ab3e3f6a2aa0bd679d2a18b36c5a1ec8ccc91490001f794abb74979f12c7"></a><!-- doxytag: member="MSMTRMX_M2" ref="ggac6569ab3e3f6a2aa0bd679d2a18b36c5a1ec8ccc91490001f794abb74979f12c7" args="" -->MSMTRMX_M2</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac6569ab3e3f6a2aa0bd679d2a18b36c5ae77b9eca6f4279743c890c36964f04df"></a><!-- doxytag: member="MSMTRMX_M3" ref="ggac6569ab3e3f6a2aa0bd679d2a18b36c5ae77b9eca6f4279743c890c36964f04df" args="" -->MSMTRMX_M3</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac6569ab3e3f6a2aa0bd679d2a18b36c5ad113520b7e049da15197e33030406c1c"></a><!-- doxytag: member="MSMTRMX_M4" ref="ggac6569ab3e3f6a2aa0bd679d2a18b36c5ad113520b7e049da15197e33030406c1c" args="" -->MSMTRMX_M4</em>&nbsp;</td><td>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="mindsensors-rcxmotormux_8h_source.html#l00045">45</a> of file <a class="el" href="mindsensors-rcxmotormux_8h_source.html">mindsensors-rcxmotormux.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga31f25843746b208a87d793fcad243c29"></a><!-- doxytag: member="mindsensors&#45;rcxmotormux.h::tMSMTRMXSettings" ref="ga31f25843746b208a87d793fcad243c29" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__msmtrmx.html#ga31f25843746b208a87d793fcad243c29">tMSMTRMXSettings</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>motor settings struct, each motor can be set to one of these modes </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga31f25843746b208a87d793fcad243c29a80f6b1c803bb06040db747f79e10f647"></a><!-- doxytag: member="MSMTRMX_MODE_FLOAT" ref="gga31f25843746b208a87d793fcad243c29a80f6b1c803bb06040db747f79e10f647" args="" -->MSMTRMX_MODE_FLOAT</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga31f25843746b208a87d793fcad243c29a19f9761620eee8451c2c17731e1d31ef"></a><!-- doxytag: member="MSMTRMX_MODE_FORWARD" ref="gga31f25843746b208a87d793fcad243c29a19f9761620eee8451c2c17731e1d31ef" args="" -->MSMTRMX_MODE_FORWARD</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga31f25843746b208a87d793fcad243c29aca501021be8cad3959e95fdea6a728e3"></a><!-- doxytag: member="MSMTRMX_MODE_REVERSE" ref="gga31f25843746b208a87d793fcad243c29aca501021be8cad3959e95fdea6a728e3" args="" -->MSMTRMX_MODE_REVERSE</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga31f25843746b208a87d793fcad243c29aac0953c88f2a1483f46c76e66bb13396"></a><!-- doxytag: member="MSMTRMX_MODE_BRAKE" ref="gga31f25843746b208a87d793fcad243c29aac0953c88f2a1483f46c76e66bb13396" args="" -->MSMTRMX_MODE_BRAKE</em>&nbsp;</td><td>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="mindsensors-rcxmotormux_8h_source.html#l00037">37</a> of file <a class="el" href="mindsensors-rcxmotormux_8h_source.html">mindsensors-rcxmotormux.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga715a0828ba4632b83617903093132021"></a><!-- doxytag: member="mindsensors&#45;rcxmotormux.h::MSMTRMX_Brake" ref="ga715a0828ba4632b83617903093132021" args="(tSensors link, tMSMTRMXMotors channel, unsigned byte brakeForce, ubyte address=MSMTRMX_I2C_ADDR)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MSMTRMX_Brake </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__msmtrmx.html#gac6569ab3e3f6a2aa0bd679d2a18b36c5">tMSMTRMXMotors</a>&#160;</td>
          <td class="paramname"> <em>channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned byte&#160;</td>
          <td class="paramname"> <em>brakeForce</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function applies the specified braking power to the specified motor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>port number </td></tr>
    <tr><td class="paramname">channel</td><td>motor number </td></tr>
    <tr><td class="paramname">brakeForce</td><td>brake power to set the motor to (0-255, 0 == float) </td></tr>
    <tr><td class="paramname">address</td><td>the I2C address to use, optional, defaults to 0xB4 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if message is sent successfully </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-rcxmotormux-test1_8c-example.html#a2">mindsensors-rcxmotormux-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="mindsensors-rcxmotormux_8h_source.html#l00108">108</a> of file <a class="el" href="mindsensors-rcxmotormux_8h_source.html">mindsensors-rcxmotormux.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga9d123ef3b2b23693ca20680d36039eab"></a><!-- doxytag: member="mindsensors&#45;rcxmotormux.h::MSMTRMX_Control" ref="ga9d123ef3b2b23693ca20680d36039eab" args="(tSensors link, tMSMTRMXMotors channel, int power, ubyte address=MSMTRMX_I2C_ADDR)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MSMTRMX_Control </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__msmtrmx.html#gac6569ab3e3f6a2aa0bd679d2a18b36c5">tMSMTRMXMotors</a>&#160;</td>
          <td class="paramname"> <em>channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>power</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>address</em> = <code>MSMTRMX_I2C_ADDR</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Function prototypes</p>
<p>This function sets the specified motor to the given power level, with the motor floated at speed zero. The controller floats during inactive PWM periods. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>port number </td></tr>
    <tr><td class="paramname">channel</td><td>motor number </td></tr>
    <tr><td class="paramname">power</td><td>speed to set the motor to (-255 to +255) </td></tr>
    <tr><td class="paramname">address</td><td>the I2C address to use, optional, defaults to 0xB4 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if message is sent successfully </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-rcxmotormux-test1_8c-example.html#a0">mindsensors-rcxmotormux-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="mindsensors-rcxmotormux_8h_source.html#l00069">69</a> of file <a class="el" href="mindsensors-rcxmotormux_8h_source.html">mindsensors-rcxmotormux.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ga42f810b071ebd8aad64978a3e4c9f35e"></a><!-- doxytag: member="mindsensors&#45;rcxmotormux.h::MSMTRMX_I2CMessage" ref="ga42f810b071ebd8aad64978a3e4c9f35e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group__msmtrmx.html#ga42f810b071ebd8aad64978a3e4c9f35e">MSMTRMX_I2CMessage</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C command data </p>

<p>Definition at line <a class="el" href="mindsensors-rcxmotormux_8h_source.html#l00052">52</a> of file <a class="el" href="mindsensors-rcxmotormux_8h_source.html">mindsensors-rcxmotormux.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
